/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronin.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author esimsek
 */
@Entity
@Table(name = "musteri_hizmet")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "MusteriHizmet.findAll", query = "SELECT m FROM MusteriHizmet m"),
    @NamedQuery(name = "MusteriHizmet.findById", query = "SELECT m FROM MusteriHizmet m WHERE m.id = :id"),
    @NamedQuery(name = "MusteriHizmet.findByFirmaId", query = "SELECT m FROM MusteriHizmet m WHERE m.firma.id = :firmaId"),
    @NamedQuery(name = "MusteriHizmet.findBySubeId", query = "SELECT m FROM MusteriHizmet m WHERE m.sube.id = :subeId"),
    @NamedQuery(name = "MusteriHizmet.findByAdet", query = "SELECT m FROM MusteriHizmet m WHERE m.adet = :adet"),
    @NamedQuery(name = "MusteriHizmet.findByZaman", query = "SELECT m FROM MusteriHizmet m WHERE m.zaman = :zaman")})
public class MusteriHizmet implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id")
    private Long id;
    @JoinColumn(name = "firma_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Firma firma;
    @JoinColumn(name = "sube_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Sube sube;
    @Basic(optional = false)
    @Column(name = "adet")
    private int adet;
    @Basic(optional = false)
    @Column(name = "zaman")
    @Temporal(TemporalType.TIMESTAMP)
    private Date zaman;
    @JoinColumn(name = "hizmet_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Hizmet hizmet;
    @JoinColumn(name = "musteri_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Musteri musteri;

    public MusteriHizmet() {
    }

    public MusteriHizmet(Long id) {
        this.id = id;
    }

    public MusteriHizmet(Long id, Firma firma, Sube sube, int adet, Date zaman) {
        this.id = id;
        this.firma = firma;
        this.sube = sube;
        this.adet = adet;
        this.zaman = zaman;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Firma getFirma() {
        return firma;
    }

    public void setFirma(Firma firma) {
        this.firma = firma;
    }

    public Sube getSube() {
        return sube;
    }

    public void setSube(Sube sube) {
        this.sube = sube;
    }

    public int getAdet() {
        return adet;
    }

    public void setAdet(int adet) {
        this.adet = adet;
    }

    public Date getZaman() {
        return zaman;
    }

    public void setZaman(Date zaman) {
        this.zaman = zaman;
    }

    public Hizmet getHizmet() {
        return hizmet;
    }

    public void setHizmet(Hizmet hizmet) {
        this.hizmet = hizmet;
    }

    public Musteri getMusteri() {
        return musteri;
    }

    public void setMusteri(Musteri musteri) {
        this.musteri = musteri;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MusteriHizmet)) {
            return false;
        }
        MusteriHizmet other = (MusteriHizmet) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ronin.model.MusteriHizmet[ id=" + id + " ]";
    }
    
}
